<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <title>${menuDetail.name}</title>
<#include "/admin/main/include/link_head.ftl"/>
</head>

<body class="jr-body">
<div class="jr-main-content">
<@tags.pageHeading />

    <div class="wrapper">

        <div class="row">
            <div class="col-md-4">
            <@tags.table id="easyui-datagrid-left" options="bodyCls:'jr-easyui-body jr-no-pagination-info',
            url:'leftPage',
            singleSelect:true,
            onSelect:'onLeftSelect'">
                <@tags.th options="field:'ck',checkbox:true"></@tags.th>
                <@tags.th options="field:'name',width:200,formatter:'uiLink',sortable:false"><@spring.message '名称' /></@tags.th>
            </@tags.table>
            <@tags.gridBtns id="tbMain" btns="search,add,remove,sort,export" urls="add:'leftEdit',remove:'leftDelete'" />
            <@tags.gridCons gridId="easyui-datagrid-left" forms="[
                        {
                            type:'text',
                            field:'name',
                            op:'like',
                            text:'名称'
                        }
                    ]" />
            </div>
            <div class="col-md-8">
            <@tags.table id="easyui-datagrid-right" options="toolbar:'#tbSlave',
            url:'rightPage',
            singleSelect:true">
                <@tags.th options="field:'ck',checkbox:true,sortable:false"></@tags.th>
                <@tags.th options="field:'no',width:100,sortable:false,align:'center'"><@spring.message '编号' /></@tags.th>
                <@tags.th options="field:'name',width:300,formatter:'uiLink',sortable:false"><@spring.message '名称' /></@tags.th>
            </@tags.table>
            <@tags.gridBtns id="tbSlave" btns="search,add,remove,sort,export" urls="add:'rightEdit',remove:'rightDelete'" />
            <@tags.gridCons gridId="easyui-datagrid-right" forms="[
                        {
                            type:'text',
                            field:'name',
                            op:'like',
                            text:'名称'
                        }
                    ]" />
            </div>
        </div>

    </div>
</div>
</body>
</html>
<#include "/admin/main/include/link_foot.ftl"/>
<script type="text/javascript">
    function onLeftSelect(rowIndex, rowData) {
        $("#easyui-datagrid-right").datagrid("load", {
            'search.eq.catId': rowData.id,
            'sort':'no',
            order:'asc'
        });
    }
    $(function () {
        $("#tbSlave .jr-add").unbind("click");
        $("#tbSlave .jr-add").click(function () {
            var selected = $("#easyui-datagrid-left").datagrid("getSelected");
            if (null == selected) {
                alert("请先选择左侧按钮类型。");
                return false;
            }
            var id = selected.id;
            win("rightEdit.do?catId=" + id + "&mid=${menuDetail.id}");
        });
    })
</script>